package com.quan.server.endpoint;

import com.quan.server.Config;
import org.springframework.stereotype.Component;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.HashMap;
import java.util.Map;

@Component
@Path("/config")
public class ConfigEndpoint {

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Response get() {
        Map<String, String> properties = new HashMap<>();
        properties.putAll(Config.getProperties());
        return Response.ok(properties).build();
    }
}